#ifndef __MOS_DEFINE_H__
#define __MOS_DEFINE_H__
#ifdef __cplusplus
extern "C" {
#endif


#include <stdio.h>

//====================数类型重定义======================================

#ifndef S8
#define S8  char
#endif
#ifndef U8
#define U8 unsigned char
#endif
#ifndef S16
#define S16 short
#endif
#ifndef U16
#define U16 unsigned short
#endif
#ifndef S32 
#define S32 int
#endif
#ifndef U32 
#define U32 unsigned int
#endif
#ifndef SL32 
#define SL32 long
#endif
#ifndef UL32
#define UL32 unsigned long
#endif
#ifndef SL64
#define SL64 long
#endif
#ifndef UL64
#define UL64 unsigned long
#endif
#ifndef SLL64
#define SLL64 long long
#endif
#ifndef ULL64
#define ULL64 unsigned long long
#endif
#ifndef SPTR
#define SPTR char *
#endif
#ifndef SPPTR
#define SPPTR char **
#endif
#ifndef USPTR
#define USPTR unsigned char *
#endif
#ifndef USPPTR
#define USPPTR unsigned char **
#endif

#ifndef BOOL
typedef enum _BOOL 
{
    FALSE = 0,
    TRUE = 1
}BOOL;
#endif

#ifndef NULL
#define NULL 0
#endif
#ifndef Void
#define Void void
#endif
#ifndef VPTR
#define VPTR void *
#endif
#ifndef size_t
#define size_t size_t
#endif


//==========================================================
#define UERR   1
#define SERR  (-1)
#define OK    0

#define NEG  (-1)   //Negative  -1
#define ZERO  0

#define XF0   2147483648;
#define XF2   0xff
#define XF4   0xffff
#define XF8   0xffffffff
#define XF16  0xffffffffffffffff


#define BYTE0  0
#define BYTE1  1
#define BYTE2  2
#define BYTE3  3
#define BYTE4  4
#define BYTE5  5
#define BYTE6  6
#define BYTE7  7
#define BYTE8  8
#define BYTE9  9


//==========================================================

#define BUF_SIZE_1        1
#define BUF_SIZE_2        2
#define BUF_SIZE_4        4
#define BUF_SIZE_8        8
#define BUF_SIZE_16       16
#define BUF_SIZE_32       32
#define BUF_SIZE_64       64
#define BUF_SIZE_128      128
#define BUF_SIZE_256      256
#define BUF_SIZE_512      512
#define BUF_SIZE_1024     1024
#define BUF_SIZE_2048     2048
#define BUF_SIZE_4096     4096
#define BUF_SIZE_8192     8192
#define BUF_SIZE_10240    10240
#define BUF_SIZE_65535    65535

#define BUF_SIZE_10       10
#define BUF_SIZE_100      100
#define BUF_SIZE_1000     1000
#define BUF_SIZE_10000    10000

//时间长度+\0
#define TIME_LEN_DAY      3    //01-31
#define TIME_LEN_MTH      3    //01-12
#define TIME_LEN_YEAR     5    //2010
#define TIME_LEN_9        9    //20100101
#define TIME_LEN_15       15   //20100101000000
#define TIME_LEN_11       11   //2010-01-01, 2010/01/01
#define TIME_LEN_20       20   //2010-01-01 00:00:00, 2010/01/01 00:00:00

//延迟秒为单位
#define TIME_DELAY_1s     1
#define TIME_DELAY_2s     2
#define TIME_DELAY_3s     3
#define TIME_DELAY_4s     4
#define TIME_DELAY_5s     5
#define TIME_DELAY_6s     6
#define TIME_DELAY_7s     7
#define TIME_DELAY_8s     8
#define TIME_DELAY_9s     9
#define TIME_DELAY_10s    10
#define TIME_DELAY_30s    30
#define TIME_DELAY_60s    60


//延迟毫秒为单位
#define TIME_DELAY_1ms       1
#define TIME_DELAY_10ms      10
#define TIME_DELAY_50ms      50
#define TIME_DELAY_100ms     100
#define TIME_DELAY_200ms     200
#define TIME_DELAY_300ms     300
#define TIME_DELAY_400ms     400
#define TIME_DELAY_500ms     500
#define TIME_DELAY_600ms     600
#define TIME_DELAY_700ms     700
#define TIME_DELAY_800ms     800
#define TIME_DELAY_900ms     900
#define TIME_DELAY_1000ms    1000

//延迟微秒为单位
#define TIME_DELAY_10us      10
#define TIME_DELAY_30us      30
#define TIME_DELAY_50us      50
#define TIME_DELAY_100us     100
#define TIME_DELAY_200us     200
#define TIME_DELAY_300us     300
#define TIME_DELAY_400us     400
#define TIME_DELAY_500us     500
#define TIME_DELAY_600us     600
#define TIME_DELAY_700us     700
#define TIME_DELAY_800us     800
#define TIME_DELAY_900us     900
#define TIME_DELAY_1000us    1000

//==========================================================
#define N0  0
#define N1  1
#define N2  2
#define N3  3
#define N4  4
#define N5  5
#define N6  6
#define N7  7
#define N8  8
#define N9  9
#define N10  10
#define N11  11
#define N12  12
#define N13  13
#define N14  14
#define N15  15
#define N16  16
#define N17  17
#define N18  18
#define N19  19
#define N20  20

enum MOS_WEEK
{
    Week_Sun = 1,
    Week_Mon,
    Week_Tue,
    Week_Wed,
    Week_Thur,
    Week_Fri,
    Week_Sat
};

enum MOS_YEAR
{
    Year_Jan = 1,
    Year_Feb,
    Year_Mar,
    Year_Apr,
    Year_May,
    Year_Jun,
    Year_Jul,
    Year_Aug,
    Year_Sep,
    Year_Oct,
    Year_Nov,
    Year_Dec
};

#ifdef __cplusplus
}
#endif

#endif  /* __MOS_DEFINE_H__ */
